<template>
  <div class="container">
    <div class="container-1200">
      <div class="title mg-B20">新增项目资料表</div>

      <el-form
        :model="projectInfoForm"
        :rules="projectInfoRules"
        ref="projectInfoForm"
        label-width="0px"
      >
        <!-- <el-form-item>
            <el-button type="primary" @click="onSave('projectInfoForm')"
              >保存为草稿</el-button
            >
            <el-button type="primary" @click="onSaveAndSubmit('projectInfoForm')"
              >保存并提交</el-button
            >
            <el-button @click="back">取消</el-button>
            </el-form-item> -->
        <div>
          <el-row class="rowBorder rowTopBorder">
            <el-col :span="12" class="col-flex request bg-ccc">项目名称</el-col>
            <!-- <el-col :span="4" class="col-flex request bg-ccc colLeftBorder"
              >项目类别</el-col
            > -->
            <el-col :span="6" class="col-flex request bg-ccc colLeftBorder"
              >企业名称</el-col
            >
            <el-col :span="6" class="col-flex request bg-ccc colLeftBorder"
              >启动时间</el-col
            >
            <!-- <el-col :span="6" class="col-flex colLeftBorder bg-ccc"
              >三年计划:投资、预计收益、创就业岗位数</el-col
            > -->
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex">
              <el-form-item prop="projectName" class="vali">
                <el-input v-model="projectInfoForm.projectName"> </el-input>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="4" class="col-flex colLeftBorder">
              <el-form-item prop="projectCategoryId" class="vali">
                <el-select
                  v-model="projectInfoForm.projectCategoryId"
                  placeholder="请选择项目类型"
                >
                  <el-option
                    v-for="item in projectCategoryDict"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col> -->
            <el-col :span="6" class="col-flex colLeftBorder">
              <el-form-item prop="companyId" class="vali">
                <el-select
                  v-model="projectInfoForm.companyId"
                  placeholder="请选择企业"
                  @change="companyIdChange"
                >
                  <el-option
                    v-for="item in companyList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6" class="col-flex colLeftBorder">
              <el-form-item prop="startDate" class="vali">
                <el-date-picker
                  v-model="projectInfoForm.startDate"
                  type="date"
                  placeholder="请选择启动时间"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="6" class="col-flex colLeftBorder">
              <el-form-item prop="syjh" class="vali">
                <el-input v-model="projectInfoForm.syjh"> </el-input>
              </el-form-item>
            </el-col> -->
          </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex request  colLeftBorder">建设内容</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
              <el-form-item prop="jsnr" class="vali">
              <el-input type="textarea" v-model="projectInfoForm.jsnr"> </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex request  colLeftBorder">建设目标</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
              <el-form-item prop="jsmb" class="vali">
              <el-input type="textarea" v-model="projectInfoForm.jsmb"> </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex request  colLeftBorder">项目概述</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
              <el-form-item prop="xmgs" class="vali">
              <el-input type="textarea" v-model="projectInfoForm.xmgs"> </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder bg-ccc">
            <el-col :span="4">
              <div>
                <div class="textCenter">商业计划书</div>
              </div>
            </el-col>
            <el-col
              :span="20"
              class="col-flex leftAlign-pd30 colLeftBorder bg-fff"
            >
              <div class="flexWithJusCenter" v-if="projectInfoForm.meta">
                   <el-link :href="projectInfoForm.meta" target="_blank" type="primary" class="link">商业计划书</el-link> 
                   </div>
                   <div class="flexWithJusCenter mg-L20">
                   <singleFileUpload @returnUrl="returnThirdUrl"></singleFileUpload>
                </div>
            </el-col>
          </el-row>

          <!-- <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">企业基本情况（一）</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex request bg-ccc leftAlign-pd30 bg-ccc">企业名称</el-col>
            <el-col :span="12" class="col-flex colLeftBorder leftAlign-pd15 ">
              <el-form-item prop="companyId" class="vali">
                <el-select
                  v-model="projectInfoForm.companyId"
                  placeholder="请选择企业"
                  @change="companyIdChange"
                >
                  <el-option
                    v-for="item in companyList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业负责人</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder  leftAlign-pd15">
              {{ projectInfoForm.linkman }}
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业负责人联系人电话</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder  leftAlign-pd15">
              {{ projectInfoForm.phone }}
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业等级注册类型</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder  leftAlign-pd15">
              {{ registrationFormate(projectInfoForm.registration) }}
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">行业类型</el-col>
            <el-col :span="12" class="col-flex colLeftBorder  leftAlign-pd15">
              {{ industryFormate(projectInfoForm.industry) }}
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业纳税人类型</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder  leftAlign-pd15">
              {{ taxTypeFormate(projectInfoForm.taxType) }}
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex request bg-ccc leftAlign-pd30 bg-ccc"
              >是否高新科技企业</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder">
              <el-form-item prop="isHighSalary" class="vali">
                <el-select
                  v-model="projectInfoForm.isHighSalary"
                  placeholder="请选择是否高新科技企业"
                >
                  <el-option :key="true" label="是" :value="true"> </el-option>
                  <el-option :key="false" label="不是" :value="false">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >是否科技型中小企业</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder">
              <el-form-item prop="isKjxzxqy" class="vali">
                <el-select
                  v-model="projectInfoForm.isKjxzxqy"
                  placeholder="请选择是否科技型中小企业"
                >
                  <el-option :key="true" label="是" :value='true'> </el-option>
                  <el-option :key="false" label="不是" :value='false'> </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex request bg-ccc leftAlign-pd30 bg-ccc"
              >是否有IPO、新三板、并购退出</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder">
              <el-form-item prop="isIpo" class="vali">
                <el-select
                  v-model="projectInfoForm.isIpo"
                  placeholder="请选择是否有IPO、新三板、并购退出"
                >
                  <el-option :key="true" label="是" :value="true"> </el-option>
                  <el-option :key="false" label="不是" :value="false">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex request bg-ccc leftAlign-pd30 bg-ccc"
              >融资轮次（种子、天使、A、B、C）</el-col
            >
            <el-col :span="12" class="col-flex colLeftBorder">
              <el-form-item prop="lzjd" class="vali">
                <el-select
                  v-model="projectInfoForm.lzjd"
                  placeholder="请选择企业纳税人类型"
                >
                  <el-option
                    v-for="item in lzjdDict"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex request bg-ccc leftAlign-pd30 bg-ccc"
              >企业资产估值</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">万元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zcgz" class="vali">
                <el-input v-model="projectInfoForm.zcgz" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">指标</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">计量单位</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">数量</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">一、企业基本情况</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >获得天使或风险投资额</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="lzjr" class="vali">
                <el-input v-model="projectInfoForm.lzjr" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业成立时注册资本</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zczb" class="vali">
                <el-input v-model="projectInfoForm.zczb" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">二、企业经济情况</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业2020至今的投资额</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="bytz" class="vali">
                <el-input v-model="projectInfoForm.bytz" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业上年总收入</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="sbysl" class="vali">
                <el-input v-model="projectInfoForm.sbysl" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >当年获得政府资金</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="dyzfzj" class="vali">
                <el-input v-model="projectInfoForm.dyzfzj" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业净利润</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="qyjll" class="vali">
                <el-input v-model="projectInfoForm.qyjll" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业出口总额</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="qyzck" class="vali">
                <el-input v-model="projectInfoForm.qyzck" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业研究与试验发展（R&D）经费支出</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="rdjfzc" class="vali">
                <el-input v-model="projectInfoForm.rdjfzc" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业实际上缴税费</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="qysjsjsf" class="vali">
                <el-input v-model="projectInfoForm.qysjsjsf" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">三、企业从业人员情况</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >企业从业人员</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="employeeNum" class="vali">
                <el-input v-model="projectInfoForm.employeeNum" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd40  bg-ccc">其中：博士</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="bsyg" class="vali">
                <el-input v-model="projectInfoForm.bsyg" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">硕士</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="ssyg" class="vali">
                <el-input v-model="projectInfoForm.ssyg" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">本科</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="bkyg" class="vali">
                <el-input v-model="projectInfoForm.bkyg" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">大专</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="dzyg" class="vali">
                <el-input v-model="projectInfoForm.dzyg" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">留学人员</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="lxry" class="vali">
                <el-input v-model="projectInfoForm.lxry" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">千人计划人数</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zrjlrs" class="vali">
                <el-input v-model="projectInfoForm.zrjlrs" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">百人计划人数</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="sbrcrs" class="vali">
                <el-input v-model="projectInfoForm.sbrcrs" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc"
              >吸纳应届大学毕业生</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">人</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="yjbys" class="vali">
                <el-input v-model="projectInfoForm.yjbys" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">四、企业知识产权情况</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >当年知识产权申请数</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zscqsq" class="vali">
                <el-input v-model="projectInfoForm.zscqsq" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >当年知识产权授权数</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zscqsqs" class="vali">
                <el-input v-model="projectInfoForm.zscqsqs" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd40  bg-ccc">其中：发明专利</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zscqfmzl" class="vali">
                <el-input v-model="projectInfoForm.zscqfmzl" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >拥有有效知识产权数</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="yyzscqs" class="vali">
                <el-input v-model="projectInfoForm.yyzscqs" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd40  bg-ccc">其中：发明专利</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="yxzscqs" class="vali">
                <el-input v-model="projectInfoForm.yxzscqs" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">软件著作权</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="rjzzq" class="vali">
                <el-input v-model="projectInfoForm.rjzzq" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">植物新品种</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zwxpz" class="vali">
                <el-input v-model="projectInfoForm.zwxpz" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">集成电路布图</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="jcdlbt" class="vali">
                <el-input v-model="projectInfoForm.jcdlbt" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">PCT专利</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="pct" class="vali">
                <el-input v-model="projectInfoForm.pct" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >购买国外专利</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">件</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="gmgwzl" class="vali">
                <el-input v-model="projectInfoForm.gmgwzl" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >技术合同交易数量</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">项</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="jshtjys" class="vali">
                <el-input v-model="projectInfoForm.jshtjys" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >技术合同交易额</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="jshtjyr" class="vali">
                <el-input v-model="projectInfoForm.jshtjyr" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >当年承担国家级科技计划项目数</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">项</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="gjkjxms" class="vali">
                <el-input v-model="projectInfoForm.gjkjxms" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >当年获得市级以上奖励</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">项</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="cjysjl" class="vali">
                <el-input v-model="projectInfoForm.cjysjl" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">五、产学研合作情况</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >产学研合作项目数</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="cxyhzxm" class="vali">
                <el-input v-model="projectInfoForm.cxyhzxm" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >产学研合作项目总金额</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">千元</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="cxyhzjr" class="vali">
                <el-input v-model="projectInfoForm.cxyhzjr" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="24" class="col-flex">六、双创载体建设情况</el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
              >建设双创载体的数量</el-col
            >
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="jssczts" class="vali">
                <el-input v-model="projectInfoForm.jssczts" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd40  bg-ccc">其中：孵化器</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="fhq" class="vali">
                <el-input v-model="projectInfoForm.fhq" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">众创空间</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="zckj" class="vali">
                <el-input v-model="projectInfoForm.zckj" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">台青创基地</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="dqjd" class="vali">
                <el-input v-model="projectInfoForm.dqjd" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">技术创新中心</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="jscxzx" class="vali">
                <el-input v-model="projectInfoForm.jscxzx" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">工程研究中心</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="gcyjzx" class="vali">
                <el-input v-model="projectInfoForm.gcyjzx" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">产业创新中心</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="cycxzx" class="vali">
                <el-input v-model="projectInfoForm.cycxzx" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="rowBorder">
            <el-col :span="12" class="col-flex leftAlign-pd80  bg-ccc">新兴研发机构</el-col>
            <el-col :span="4" class="col-flex colLeftBorder">个</el-col>
            <el-col :span="8" class="col-flex colLeftBorder">
              <el-form-item prop="xxyfjg" class="vali">
                <el-input v-model="projectInfoForm.xxyfjg" type="number">
                </el-input>
              </el-form-item>
            </el-col>
          </el-row> -->

        </div>
        <div class="mg-T20">
          <el-form-item>
            <el-button type="primary" @click="onSave('projectInfoForm')"
              >保存为草稿</el-button
            >
            <el-button type="primary" @click="onSaveAndSubmit('projectInfoForm')"
              >保存并提交</el-button
            >
            <el-button @click="back">取消</el-button>
          </el-form-item>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script>
import SingleUpload from "@/components/Upload/singleUpload";
import singleFileUpload from "@/components/Upload/singleFileUpload";
import { find as companyFind, list as companyList } from "@/api/company";
import { list as dictList } from "@/api/dict";
import utils from "@/utils/utils.js";
import { validPhone, validPositiveIntAndZero } from "@/utils/validate.js";
import { save as projectSave } from "@/api/project";
import {list as officeList} from '@/api/sysOffice'

export default {
  components: { SingleUpload, singleFileUpload },
  name: "projectAdd",
  data() {
    const validatePhone = (rule, value, callback) => {
      if (utils.isNull(value)) {
        callback(new Error("请输入负责人号码"));
      } else if (!validPhone(value)) {
        callback(new Error("负责人手机号码不正确"));
      } else {
        callback();
      }
    };

    const validateZcgz = (rule, value, callback) => {
      if (utils.isNull(value)) {
        callback(new Error("请输入企业资产估计"));
      } else if (!validPositiveIntAndZero(value)) {
        callback(new Error("必须为大于等于0的数值"));
      } else {
        callback();
      }
    };

    const validateCapital = (rule, value, callback) => {
      if (utils.isNull(value)) {
        callback();
      } else if (!validPositiveIntAndZero(value)) {
        callback(new Error("必须为大于等于0的数值"));
      } else {
        callback();
      }
    };

    return {
      projectInfoForm: {
        projectName: "", //项目名称
        projectCategoryId: "", //项目类别
        startDate: "", //启动时间
        jsmb: "", //建设目标
        syjh: "", //三年计划(投资，收益，岗位)
        jsnr: "", //建设内容
        xmgs: "", //项目概述
        meta: "", //商业计划书（可上传word、ppt、pdf文档）

        compnayName: "", // '企业名称',
        linkman: "", // '负责人',
        phone: "", // '负责人联系方式',

        industry: "", // '行业类别(dict.key=industry)',
        registration: "", // '行业类别(dict.key=registration)',
        taxType: "", // '纳税类型(dict.key=taxType)',

        isIpo: "", // '是否有IP、新三板、并购退出',
        isHighSalary: "", // '是否高薪技术企业',
        isKjxzxqy: "", //是否科技型中小企业
        lzjd: "", // '融资进度（0.无、1.种子、2.天使、3.A、4.B、5.C等）',
        zcgz: "", // '企业资产估计(万元)',

        zczb: "", // '企业成立时注册资本(千元)',
        lzjr: "", // '获取天使或风险投资额(千元)',

        bytz: "", // '企业本年度投资额(千元)',
        sbysl: "", // '企业上半总收入(千元)',
        dyzfzj: "", // '当年获取政府资金(千元)',
        qyjll: "", // '企业净利润(千元)',
        qyzck: "", // '企业总出口额(千元)',
        rdjfzc: "", //企业研究与试验发展（R&D）经费支出
        qysjsjsf: "", //企业实际上缴税费

        employeeNum: "", //企业从业人员
        bsyg: "", // '企业从业人员(博士)',
        ssyg: "", // '企业从业人员(硕士)',
        bkyg: "", // '企业从业人员(本科)',
        dzyg: "", // '企业从业人员(大专)',

        lxry: "", // '留学人员',
        zrjlrs: "", // '千人计划人数',
        sbrcrs: "", // '双百人才人数',
        yjbys: "", // '吸纳应届毕业生',

        zscqsq: "", // '知识产权申请数',
        zscqsqs: "", // '知识产权授权数',
        zscqfmzl: "", // '知识产权发明专利',

        yyzscqs: "", // '拥有有效知识产权',
        yxzscqs: "", // '有效知识产权发明专利',
        rjzzq: "", // '软件著作权',
        zwxpz: "", // '植物新品种',
        jcdlbt: "", // '集成电路布图',
        pct: "", // 'PCT专利',
        gmgwzl: "", // '购买国外专利',
        jshtjys: "", // '技术合同交易数量',
        jshtjyr: "", // '技术合同交易金额',
        gjkjxms: "", // '当年承担国家级科技计划项目数',
        cjysjl: "", // '当年获取市级以上奖励',
        cxyhzxm: "", // '产学研合作项目数',
        cxyhzjr: "", // '产学研合作项目总金额',

        jssczts: "", // '建设双创载体数量',
        fhq: "", // '孵化器',
        zckj: "", // '众创空间',
        dqjd: "", // '台青创基地',
        jscxzx: "", // '技术创新中心',
        gcyjzx: "", // '工程研究中心',
        cycxzx: "", // '产业创新中心',
        xxyfjg: "", // '新型研发机构',

        officeId: "", // '所属部门',
        userId: "", // '用户ID',
        companyId: "", // '所属公司',
        status: 0, // '状态(0.草稿,1.提交,2.审核,3.驳回)',
        memo: "", // '驳回说明',
      },
      projectInfoRules: {
        projectName: [
          { required: true, message: "请输入项目名称", trigger: "blur" },
        ],
        // projectCategoryId:[
        //    { required: true, message: "请选择项目类别", trigger: "blur" },
        // ],
        jsnr: [
          { required: true, message: "请输入建设内容", trigger: "blur" },
        ],
        xmgs:[
           { required: true, message: "请选择项目概述", trigger: "blur" },
        ],
        jsmb: [
          { required: true, message: "请输入建设目标", trigger: "blur" },
        ],
        startDate: [
          { required: true, message: "请选择启动时间", trigger: "blur" },
        ],
        companyId: [{ required: true, message: "请选择企业", trigger: "blur" }],
        // linkman: [{ required: true, message: "请输入负责人", trigger: "blur" }],
        // phone: [{ required: true, validator: validatePhone, trigger: "blur" }],

        isIpo: [
          {
            required: true,
            message: "请选择是否有IP、新三板、并购退出",
            trigger: "blur",
          },
        ],
        isHighSalary: [
          {
            required: true,
            message: "请选择是否高薪技术企业",
            trigger: "blur",
          },
        ],
        lzjd: [{ required: true, message: "请选择融资进度", trigger: "blur" }],
        zcgz: [{ required: true, validator: validateZcgz, trigger: "blur" }],

        zczb: [{ required: true, validator: validateCapital, trigger: "blur" }],
        lzjr: [{ required: true, validator: validateCapital, trigger: "blur" }],

        bytz: [{ required: true, validator: validateCapital, trigger: "blur" }], // '企业本年度投资额(千元)',
        sbysl: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '企业上半总收入(千元)',
        dyzfzj: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '当年获取政府资金(千元)',
        qyjll: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '企业净利润(千元)',
        qyzck: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '企业总出口额(千元)',
        rdjfzc: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], //企业研究与试验发展（R&D）经费支出
        qysjsjsf: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], //企业实际上缴税费

        employeeNum: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], //企业从业人员
        bsyg: [{ required: true, validator: validateCapital, trigger: "blur" }], // '企业从业人员(博士)',
        ssyg: [{ required: true, validator: validateCapital, trigger: "blur" }], // '企业从业人员(硕士)',
        bkyg: [{ required: true, validator: validateCapital, trigger: "blur" }], // '企业从业人员(本科)',
        dzyg: [{ required: true, validator: validateCapital, trigger: "blur" }], // '企业从业人员(大专)',

        lxry: [{ required: true, validator: validateCapital, trigger: "blur" }], // '留学人员',
        zrjlrs: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '千人计划人数',
        sbrcrs: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '双百人才人数',
        yjbys: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '吸纳应届毕业生',

        zscqsq: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '知识产权申请数',
        zscqsqs: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '知识产权授权数',
        zscqfmzl: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '知识产权发明专利',

        yyzscqs: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '拥有有效知识产权',
        yxzscqs: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '有效知识产权发明专利',
        rjzzq: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '软件著作权',
        zwxpz: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '植物新品种',
        jcdlbt: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '集成电路布图',
        pct: [{ required: true, validator: validateCapital, trigger: "blur" }], // 'PCT专利',
        gmgwzl: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '购买国外专利',
        jshtjys: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '技术合同交易数量',
        jshtjyr: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '技术合同交易金额',
        gjkjxms: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '当年承担国家级科技计划项目数',
        cjysjl: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '当年获取市级以上奖励',
        cxyhzxm: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '产学研合作项目数',
        cxyhzjr: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '产学研合作项目总金额',

        jssczts: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '建设双创载体数量',
        fhq: [{ required: true, validator: validateCapital, trigger: "blur" }], // '孵化器',
        zckj: [{ required: true, validator: validateCapital, trigger: "blur" }], // '众创空间',
        dqjd: [{ required: true, validator: validateCapital, trigger: "blur" }], // '台青创基地',
        jscxzx: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '技术创新中心',
        gcyjzx: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '工程研究中心',
        cycxzx: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '产业创新中心',
        xxyfjg: [
          { required: true, validator: validateCapital, trigger: "blur" },
        ], // '新型研发机构',
      },

      //字典数据
      taxTypeDict: [],
      registrationDict: [],
      companyStatusDict: [],
      lzjdDict: [],
      industryDict:[],
      projectCategoryDict:[],
      industryDictPromise:"",

      companyId: "",
      companyInfo: {},
      companyList: [],

      scroll:"",
      path: "",
    };
  },
  watch: {
    $route: {
      handler: function (route) {
        this.path = route.path
      },
      immediate: true,
    },
  },

  activated(){
    console.log('activated执行了--',);
    if(this.$store.getters.closeAliveName == "projectAdd"){
      console.log('activated执行了--',this.$store.getters);
      this.projectInfoForm = {
        projectName: "", //项目名称
        projectCategoryId: "", //项目类别
        startDate: "", //启动时间
        jsmb: "", //建设内容及目标
        syjh: "", //三年计划(投资，收益，岗位)
        jsnr: "", //建设内容
        xmgs: "", //项目概述
        meta: "", //商业计划书（可上传word、ppt、pdf文档）

        compnayName: "", // '企业名称',
        linkman: "", // '负责人',
        phone: "", // '负责人联系方式',

        industry: "", // '行业类别(dict.key=industry)',
        registration: "", // '行业类别(dict.key=registration)',
        taxType: "", // '纳税类型(dict.key=taxType)',

        isIpo: "", // '是否有IP、新三板、并购退出',
        isHighSalary: "", // '是否高薪技术企业',
        isKjxzxqy: "", //是否科技型中小企业
        lzjd: "", // '融资进度（0.无、1.种子、2.天使、3.A、4.B、5.C等）',
        zcgz: "", // '企业资产估计(万元)',

        zczb: "", // '企业成立时注册资本(千元)',
        lzjr: "", // '获取天使或风险投资额(千元)',

        bytz: "", // '企业本年度投资额(千元)',
        sbysl: "", // '企业上半总收入(千元)',
        dyzfzj: "", // '当年获取政府资金(千元)',
        qyjll: "", // '企业净利润(千元)',
        qyzck: "", // '企业总出口额(千元)',
        rdjfzc: "", //企业研究与试验发展（R&D）经费支出
        qysjsjsf: "", //企业实际上缴税费

        employeeNum: "", //企业从业人员
        bsyg: "", // '企业从业人员(博士)',
        ssyg: "", // '企业从业人员(硕士)',
        bkyg: "", // '企业从业人员(本科)',
        dzyg: "", // '企业从业人员(大专)',

        lxry: "", // '留学人员',
        zrjlrs: "", // '千人计划人数',
        sbrcrs: "", // '双百人才人数',
        yjbys: "", // '吸纳应届毕业生',

        zscqsq: "", // '知识产权申请数',
        zscqsqs: "", // '知识产权授权数',
        zscqfmzl: "", // '知识产权发明专利',

        yyzscqs: "", // '拥有有效知识产权',
        yxzscqs: "", // '有效知识产权发明专利',
        rjzzq: "", // '软件著作权',
        zwxpz: "", // '植物新品种',
        jcdlbt: "", // '集成电路布图',
        pct: "", // 'PCT专利',
        gmgwzl: "", // '购买国外专利',
        jshtjys: "", // '技术合同交易数量',
        jshtjyr: "", // '技术合同交易金额',
        gjkjxms: "", // '当年承担国家级科技计划项目数',
        cjysjl: "", // '当年获取市级以上奖励',
        cxyhzxm: "", // '产学研合作项目数',
        cxyhzjr: "", // '产学研合作项目总金额',

        jssczts: "", // '建设双创载体数量',
        fhq: "", // '孵化器',
        zckj: "", // '众创空间',
        dqjd: "", // '台青创基地',
        jscxzx: "", // '技术创新中心',
        gcyjzx: "", // '工程研究中心',
        cycxzx: "", // '产业创新中心',
        xxyfjg: "", // '新型研发机构',

        officeId: "", // '所属部门',
        userId: "", // '用户ID',
        companyId: "", // '所属公司',
        status: 0, // '状态(0.草稿,1.提交,2.审核,3.驳回)',
        memo: "", // '驳回说明',
      },
      this.scroll = 0;
      this.$store.dispatch("user/cleanCloseAliveName")
    }else{
      if(this.scroll > 0){
       window.scrollTo(0, this.scroll);
       this.scroll = 0;
    }
    }
    window.addEventListener('scroll', this.handleScroll);
    // console.log('activated执行了--',this.$store.getters.closeAliveName);
  },

  deactivated(){
     window.removeEventListener('scroll', this.handleScroll);
},

  created() {
    // if (this.$route.query) {
    //   this.companyId = this.$route.query.companyId;
    //   this.companyFind(this.companyId);
    // }
    utils.getDictList("tax_type", (res) => {
      this.taxTypeDict = res.data;
    });
    utils.getDictList("registration", (res) => {
      this.registrationDict = res.data;
    });
    utils.getDictList("lzjd", (res) => {
      this.lzjdDict = res.data;
    });
    this.industryDictPromise = utils.getDictList("industry", (res) => {
      this.industryDict = res.data;
    });
    this.projectCategoryDictPromise = utils.getDictList("projectCategory", (res) => {
      this.projectCategoryDict = res.data;
    });
    this.officeList()
  },

  mounted() {
    window.addEventListener('scroll', this.handleScroll);
    this.getcompanyList();
  },

  destroyed() {},

  methods: {
    returnThirdUrl(data) {
      console.log("data--", data);
      this.projectInfoForm.meta = data.url;
    },

    //监听滚动条
    handleScroll () {
      let scrollTop = document.documentElement.scrollTop;
      this.scroll = scrollTop;
      console.log('scrollTop--',document.documentElement.scrollTop);
    },

      officeList() {
        let _this = this;
        let params = new URLSearchParams();
        params.append('menuType', 0);
        officeList(params).then(response => {
          console.log(response)
          this.projectInfoForm.officeId = response.data[0].id;
        }).catch(error => {
          console.log('error!!')
        });
      },

    //公司选项变化
    companyIdChange(data) {
      console.log("公司选项变化data--", data);
      this.companyFind(data);
    },

    //获取公司信息
    companyFind(id) {
      companyFind(id).then((res) => {
        console.log("获取公司信息res--", res);
        if (res.type == "success") {
          this.companyInfo = res.data.company;
          this.projectInfoForm.compnayName = res.data.company.name;
          this.projectInfoForm.linkman = res.data.company.linkman;
          this.projectInfoForm.phone = res.data.company.phone;
          this.projectInfoForm.registration = res.data.company.registration;
          this.projectInfoForm.industry = res.data.company.industry;
          this.projectInfoForm.taxType = res.data.company.taxType;
        }
      });
    },

    //获取公司列表
    getcompanyList() {
      let _this = this;
      let params = new URLSearchParams();
      params.append("pageNum", 1);
      params.append("pageSize", 10000);
      companyList(params)
        .then((res) => {
          console.log("companyList成功获取数据--", res);
          if (res.type == "success") {
            this.companyList = res.data.data;
          }
        })
        .catch((err) => {
          this.$message.error(err.msg);
        });
    },

    onSaveAndSubmit(formName){
      this.projectInfoForm.status = 1
      this.onSave(formName)
    },

    //表单提交事件
    onSave(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          projectSave(this.projectInfoForm)
            .then((res) => {
              console.log("projectSave成功获取数据--", res);
              if (res.type == "success") {
                this.$message.success("新增项目登记成功");
                this.$store.dispatch("user/setCloseView", this.path)
                this.$router.push({
                  path: "/project/list",
                  query: { companyId: this.companyId },
                });
              }
            })
            .catch((err) => {
              this.$message.error(err.msg);
            });
        }else{
          this.$message.warning("注意！还有未完善内容")
        }
      });
    },

    back(){
      this.$router.go(-1)
    },

    //字典数据格式化
    taxTypeFormate(data) {
      console.log("纳税data--", data);
      return utils.selectDictLabel(this.taxTypeDict, data);
    },

    registrationFormate(data) {
      return utils.selectDictLabel(this.registrationDict, data);
    },
    
    industryFormate(data) {
      return utils.selectDictLabel(this.industryDict, data);
    },
  },
};
</script>

<style lang="scss" scoped>
/deep/ .vali .el-form-item__content .el-form-item__error {
  top: 5px !important;
  right: 30px !important;
  left: unset !important;
  // left: 80% !important;
}

/deep/ .el-date-editor {
  width: 100%;
}

/deep/ .el-date-editor .el-input__inner {
  padding-right: 0px !important;
}

/deep/ .el-input__inner {
  border: 1px solid #fff !important;
}

.el-select {
  width: 100%;
}
.el-form-item {
  margin: 0;
  width: 100%;
}
</style>
